package cn.android.weblog.dao.impl;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import net.minidev.json.JSONObject;

import org.jsoup.Connection;

import cn.android.weblog.dao.UserDao;
import cn.android.weblog.domain.User;
import cn.android.weblog.util.HttpUtils;

public class UserDaoImpl implements UserDao {

    @Override
    public User findUserMore(Integer userId) {
        return null;
    }

    @Override
    public String login(String userId, String password) {
        Map<String,String> params=new HashMap<>();
        params.put("userId",userId);
        params.put("password",password);
        Connection.Response post = null;
        try {
            post=HttpUtils.post("/user/login", JSONObject.toJSONString(params));
        } catch (IOException e) {
            e.printStackTrace();
        }
        return post.body();
    }

    @Override
    public User findByUserId(Integer userId) {
        return null;
    }

    @Override
    public int update(User user) {
        return 0;
    }

    @Override
    public int delUser(User user) {
        return 0;
    }

    @Override
    public int changePassage(Integer userId, String password) {
        return 0;
    }

    @Override
    public int addUser(User user) {
        return 0;
    }

    @Override
    public int findPassword(Integer userId, String password){
        return 0;
    }

}
